package com.exception.exceptiondemo.exception;


import com.exception.exceptiondemo.exceptionEnum.CustomExceptionType;
/**
 * 自定义异常
 */
public class CustomException extends RuntimeException {
    /**
     * 异常错误编码
     */
    private int code;

    /**
     * 异常信息
     */
    private String message;

    /**
     * 用户异常
     *
     * @param exceptionTypeEnum
     * @param message
     */
    public CustomException(CustomExceptionType exceptionTypeEnum, String message) {
        this.code = exceptionTypeEnum.getCode();
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }



}
